package cn.sykj.car.service;

import cn.sykj.car.common.ResponseBean;
import cn.sykj.car.entity.Users;
import cn.sykj.car.vo.UsersVO;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

import java.lang.reflect.InvocationTargetException;
import java.util.List;

/**
 * <p>
 * 用户 服务类
 * </p>
 *
 * @author Yixu
 * @since 2018-11-29
 */
public interface IUsersService extends IService<Users> {
    /**
     * 添加用户
     *
     * @param users
     * @return
     * @throws Exception
     * @author yuhao
     * @version 2018-12-05 11:52
     */
    public boolean insertUsers(UsersVO users) throws Exception;

    /**
     * 修改用户
     *
     * @param users
     * @return
     * @throws Exception
     * @author yuhao
     * @version 2018-12-05 11:52
     */
    public boolean updateUsers(UsersVO users) throws Exception;

    /**
     * 删除用户
     *
     * @param users 根据id删除菜单
     * @return
     * @throws Exception
     * @author yuhao
     * @version 2018-12-05 11:52
     */
    public boolean deleteUsers(UsersVO users) throws Exception;

    /**
     * 查看单个用户
     *
     * @param users
     * @return
     * @author yuhao
     * @version 2018-12-05 11:52
     */
    public Users selectOneUsers(UsersVO users) throws InvocationTargetException, IllegalAccessException;

    /**
     * 分页查看用户
     *
     * @param page      分页器
     * @param condition 查询条件
     * @return
     * @author yuhao
     * @version 2018-12-05 11:52
     */
    public Page<UsersVO> pageUsers(Page<UsersVO> page, UsersVO condition);

    /**
     * 通过userName查找用户
     *
     * @param userName
     * @return
     */
    public Users getUserByName(String userName);

    /**
     * 根据角色id查询用户
     * @param roleId
     * @return
     * @author yuhao 2018-12-07 15:56
     */
    public List<Users> selectUsersByRoleId(Integer roleId);

}
